#ifndef MEGA48SERIAL_H_693b0cc9_defb_4d7c_93ed_74a7569889bc
#define MEGA48SERIAL_H_693b0cc9_defb_4d7c_93ed_74a7569889bc

/*
**
** Copyright (c) 2010 by Lorimark Solutions, LLC.
** All Rights Reserved.
** Send inquiries to: info@lorimarksolutions.com
**
*/

#include <evie-systems.h>

#define RX_USART_BUFFER_SIZE        50
#define RX_USART_INTERRUPT_ENABLE   UCSR0B |=  (1<<RXCIE0)
#define RX_USART_INTERRUPT_DISABLE  UCSR0B &= ~(1<<RXCIE0)

#define TX_USART_BUFFER_SIZE        30
#define TX_USART_INTERRUPT_ENABLE   UCSR0B |=  (1<<UDRIE0)
#define TX_USART_INTERRUPT_DISABLE  UCSR0B &= ~(1<<UDRIE0)
#define TX_USART_RUNNING            ((UCSR0A & ~(1<<TXC0)) == 0)

void rxUsartReset(uint8 channel);
uint8 rxUsartCount(uint8 channel);
uint8 rxUsartSpace(uint8 channel);
void rxUsartPut( uint8 data );
uint8 rxUsartGet(uint8 channel);
void txUsartReset(uint8 channel);
uint8 txUsartCount(uint8 channel);
uint8 txUsartSpace(uint8 channel);
void txUsartPut( uint8 channel, uint8 data );
uint8 txUsartGet(uint8 channel);
void init_usart(uint8 channel);

#endif // MEGA48SERIAL_C_693b0cc9_defb_4d7c_93ed_74a7569889bc

